package com.study.delegate.simple;

import java.util.HashMap;
import java.util.Map;

public class Leader implements IEmployee {

    private Map<String,IEmployee> employeeMap = new HashMap<>();

    public Leader() {
        employeeMap.put("java",new EmployeeA());
        employeeMap.put("效果图",new EmployeeB());
    }

    @Override
    public void doing(String task) {
        if(!employeeMap.containsKey(task)){
            System.out.println("做不了");
            return;
        }
        employeeMap.get(task).doing(task);
    }
}
